package com.example.houqin_oa.controller;

import com.example.comment_oa.pojos.CollectTemplate;
import com.example.comment_oa.response.AjaxResponse;
import com.example.houqin_oa.service.CollectTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:领取物品编号
 * @Author:陈旭良
 * @Documents_And_Settings:liang
 * @Date:2022/10/27 13:56
 * @Entry_Name:my_springcloud_project01cangku
 */
@RestController
@CrossOrigin
@RequestMapping("/houqinOa")
public class TemplateController {
    @Autowired
    CollectTemplateService collectTemplateService;

    @PostMapping("/Collect/TemplateAll")
    public AjaxResponse TemplateAll(@RequestBody CollectTemplate collectTemplate){
        return AjaxResponse.success(collectTemplateService.TemplateAll(collectTemplate));
    }

    @PostMapping("/Collect/AddTemplate")
    public AjaxResponse AddTemplate(@RequestBody CollectTemplate collectTemplate){
        return AjaxResponse.success(collectTemplateService.AddTemplate(collectTemplate));
    }
    @PostMapping("/Collect/Modify")
    public AjaxResponse Modify(@RequestBody CollectTemplate collectTemplate){
        return AjaxResponse.success(collectTemplateService.Modify(collectTemplate));
    }

    @PostMapping("/Collect/DelTemplate")
    public AjaxResponse DelTemplate(@RequestBody CollectTemplate collectTemplate){
        return AjaxResponse.success(collectTemplateService.DelTemplate(collectTemplate));
    }

    @PostMapping("/collect/allCollectDet")
    public AjaxResponse allCollectDet(@RequestBody CollectTemplate collectTemplate){
        return AjaxResponse.success(collectTemplateService.allCollectDet(collectTemplate));
    }
}
